package bandidong.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

@Embeddable
public class OrderDetailsPK implements Serializable {
    
    @NotNull
    @Column(name = "order_id", nullable = false)
    private int orderId;
    
    @NotNull
    @Column(name = "mobile_id", nullable = false)
    private int mobileId;

    public OrderDetailsPK() {
    }

    public OrderDetailsPK(int orderId, int mobileId) {
        this.orderId = orderId;
        this.mobileId = mobileId;
    }

    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    public int getMobileId() {
        return mobileId;
    }

    public void setMobileId(int mobileId) {
        this.mobileId = mobileId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) orderId;
        hash += (int) mobileId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof OrderDetailsPK)) {
            return false;
        }
        OrderDetailsPK other = (OrderDetailsPK) object;
        if (this.orderId != other.orderId) {
            return false;
        }
        if (this.mobileId != other.mobileId) {
            return false;
        }
        return true;
    }
}
